// DownloadDlg.cpp : implementation file
//

#include "stdafx.h"
#include "TrojClient.h"
#include "DownloadDlg.h"
#include "TrojClientDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// DownloadDlg dialog


DownloadDlg::DownloadDlg(CWnd* pParent /*=NULL*/)
	: CDialog(DownloadDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(DownloadDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void DownloadDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(DownloadDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(DownloadDlg, CDialog)
	//{{AFX_MSG_MAP(DownloadDlg)
	ON_BN_CLICKED(IDC_BUTTON1, OnSelectDir)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// DownloadDlg message handlers

void DownloadDlg::OnSelectDir() 
{
	CString str;
	BROWSEINFO bi;
	ZeroMemory(&bi,sizeof(BROWSEINFO));
	bi.hwndOwner=GetSafeHwnd();
	bi.lpszTitle="Browse";
	LPITEMIDLIST idl=SHBrowseForFolder(&bi);
	if(idl==NULL)
		return;
	SHGetPathFromIDList(idl,str.GetBuffer());

	CMyDlg::SetPubDir(str);

	GetDlgItem(IDC_EDIT_DIR)->SetWindowText(str.LockBuffer());

	
}
